<?php 
header("Content-type: text/html; charset=utf-8");

$user1=array('学校'=>'东软',
			'系别'=>'计算机科学技术系',
			'导员'=>'杨冠尧',
			'班级'=>'计算机14004',
			'学号'=>'14110100421',
			'女朋友'=>'赵庆阳',
			'爱好'=>array('吃','喝','拉','撒'),
			'家乡'=>'秦皇岛'
	
			);
$user2=array('学校'=>'东软',
			'系别'=>'计算机科学技术系',
			'导员'=>'杨冠尧',
			'班级'=>'计算机14004',
			'学号'=>'14110100401',
			'女朋友'=>'冯科',
			'爱好'=>array('吃','喝','嫖','赌'),
			'家乡'=>'中国'
	
			);
$user3=array('学校'=>'东软',
			'系别'=>'计算机科学技术系',
			'导员'=>'杨冠尧',
			'班级'=>'计算机14004',
			'学号'=>'14110100402',
			'女朋友'=>'冯总台',
			'爱好'=>array('吃','喝','嫖','赌'),
			'家乡'=>'马来西亚'
	
			);
$student=array($user1,$user2,$user3);
$type1=array('tname'=>'学生','people'=>array($user1,$user2));
$type2=array('tname'=>'上班族','people'=>array($user3));
//var_dump($student);
/*echo "<table align='center' border='1'> ";
echo"<tr>";
echo "<th>序号</th>";
echo "<th>学校</th>";
echo "<th>系别</th>";
echo "<th>导员</th>";
echo "<th>班级</th>";
echo "<th>学号</th>";
echo "<th>女朋友</th>";
echo "<th>爱好</th>";
echo "<th>家乡</th>";
echo"</tr>";
foreach ($student as $i=> $user) {
echo"<tr>";	
echo"<td>".($i+1)."</td>";
foreach ($user as $v)
{
	echo "<td>";
	if (is_array($v)) 
	{
		$v=implode(",", $v);
	}
	echo $v;
	echo "</td>";

}

echo"</tr>";

}
echo"</table>";
*/

echo "<table align='center' border='1'> ";
echo"<tr>";
echo "<th>序号</th>";
echo "<th>学校</th>";
echo "<th>系别</th>";
echo "<th>导员</th>";
echo "<th>班级</th>";
echo "<th>学号</th>";
echo "<th>女朋友</th>";
echo "<th>爱好</th>";
echo "<th>家乡</th>";
echo"</tr>";
foreach ($usertype as $i=> $type){
foreach ($type as $j=> $user){
foreach ($user as $k=> $v) {
if (is_array($v)) {
	$v=implode(",", $v);}
}
echo $v;

}}}
echo"<tr>";	
echo"<td>".($i+1)."</td>";
foreach ($user as $v)
{
	echo "<td>";
	if (is_array($v)) 
	{
		$v=implode(",", $v);
	}
	echo $v;
	echo "</td>";

}

echo"</tr>";

}
echo"</table>";

echo "<table align='center' border='1'> ";
echo"<tr>";
echo "<th>序号</th>";
echo "<th>学校</th>";
echo "<th>系别</th>";
echo "<th>导员</th>";
echo "<th>班级</th>";
echo "<th>学号</th>";
echo "<th>女朋友</th>";
echo "<th>爱好</th>";
echo "<th>家乡</th>";
echo"</tr>";
foreach ($type2 as $i=> $user) {
echo"<tr>";	
echo"<td>".($i+1)."</td>";
foreach ($user as $v)
{
	echo "<td>";
	if (is_array($v)) 
	{
		$v=implode(",", $v);
	}
	echo $v;
	echo "</td>";

}

echo"</tr>";

}
echo"</table>";
/*foreach ($user as   $key=>$one) 
{
	echo $key;
if (is_array($one)) 
foreach ($one as  $v) 
{echo $v;}
	else echo ':'.$one;
	
}*/
 ?>